function fig6_2

figure(1)
clf
% get(gcf)
set(gcf,'Position', [25 1115 658 230])
co = [0 0 1;
    0 0.5 0;
    1 0 0;
    0 0.75 0.75;
    0.75 0 0.75;
    0.75 0.75 0;
    0.25 0.25 0.25];
set(groot,'defaultAxesColorOrder',co)
subaxis(1,1,1,1,'MT',0.01,'MB',0.18,'MR',-0.02,'ML',0.05,'P',0.04)

hold on
box on
grid on

nx=200;
x=linspace(0,1,nx);
a=0.4; b=0.4;
ep=0.1;

for ix=1:nx
    y=x(ix)/ep;
    d(ix)=1/(1+a*x(ix)+b*cos(2*y)*sin(3*y));
    %d(ix)=1/(1+a*x(ix)+b*(1-exp(-y))*sin(3*y));
    %d2(ix)=1/(1+a*x(ix)+b*g);
end

hold on
box on
grid on

plot(x,d,'-','Linewidth',1.1)

axis([0 1 0.58 1.3])

ax = gca;
ax.XAxis.TickLabelInterpreter = 'latex';
ax.YAxis.TickLabelInterpreter = 'latex';
set(gca,'FontSize',13)

xlabel('$x$\,-\,axis','Interpreter','latex','FontSize',14)
ylabel('D','Interpreter','latex','FontSize',14)

%exportgraphics(gcf,'/Users/mark/Desktop/fig51b.pdf')

%return

figure(2)
clf
% get(gcf)
set(gcf,'Position', [26 794 658 230])
subaxis(1,1,1,1,'MT',0.01,'MB',0.18,'MR',-0.02,'ML',0.05,'P',0.04)

hold on
box on
grid on

a=-0.2; b=0.2;

s=-1;
xx=linspace(0,1,17);
for i=1:16
    s=-s;
    g=exp(4*xx(i)*(xx(i)-1));
    d2=1/(1+a*xx(i)+b*g*s);
    plot([xx(i) xx(i+1)], [d2 d2],'b','Linewidth',1.2)
end

hold on
box on
grid on
%axis([0 1 0.88 1.23])
ax = gca;
ax.XAxis.TickLabelInterpreter = 'latex';
ax.YAxis.TickLabelInterpreter = 'latex';
set(gca,'FontSize',13)

xlabel('$x$\,-\,axis','Interpreter','latex','FontSize',14)
ylabel('D','Interpreter','latex','FontSize',14)

%exportgraphics(gcf,'/Users/mark/Desktop/fig51a.pdf')








